/**
* Copyright (c) 2022 Beijing Jiaotong University
* PhotLab is licensed under [Open Source License].
* You can use this software according to the terms and conditions of the [Open Source License].
* You may obtain a copy of [Open Source License] at: [https://open.source.license/]
* 
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* 
* See the [Open Source License] for more details.
* 
* Author: Zhenjie Wei
* Created: Mar. 22, 2023
* Supported by: National Key Research and Development Program of China
*/

@mixin resource-drawer-content {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    box-sizing: border-box;
    .resource-tab {
        flex: 1;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        box-sizing: border-box;
        overflow-y: auto;
        .tabs-content {
            flex: 1;
            flex-shrink: 0;
            width: 100%;
            box-sizing: border-box;
            border-bottom: 10px solid $border_light;
            overflow-y: auto;
            position: relative;
            .tabs-sticky {
                position: sticky;
                top: 0;
                padding: 10px 10px 0;
                z-index: 3;
                background-color: #fff;
                .pui-tabs {
                    border-radius: 4px;
                    .pui-tabs_content {
                        width: 100%;
                        .pui-tab {
                            padding: 0;
                            margin: 0;
                            &.active-tab {
                                box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.4);
                            }
                            &:hover {
                                box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.4);
                            }
                        }
                    }
                }
            }
            .tabs-tree {
                padding: 10px;
                position: relative;
                .pui-tree {
                    .pui-tree_box {
                        border: none;
                        .pui-tree-children {
                            .pui-tree-children_content {
                                .pui-tree-children_content-list {
                                    .pui-tree-children_content-item {
                                        overflow: hidden;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        .file-content {
            flex-shrink: 0;
            height: 45%;
            box-sizing: border-box;
            width: 100%;
            position: relative;
            overflow-y: auto;
            .file-list {
                padding: 10px;
                display: flex;
                flex-wrap: wrap;
                align-items: flex-start;
                justify-content: flex-start;
                box-sizing: border-box;
                .file-container {
                    &:nth-child(2n-1) {
                        margin-right: 10px;
                    }
                    &.nom {
                        margin-bottom: 0;
                    }
                    .file-item {
                        width: 106px;
                        height: 106px;
                        display: flex;
                        flex-direction: column;
                        align-items: center;
                        justify-content: center;
                        cursor: pointer;
                        transition: all 0.3s ease-in-out;
                        margin-bottom: 10px;
                        border-radius: 4px;
                        &:hover {
                            background: $border-deep_light;
                        }
                        &.active-item {
                            background: $border-deep_light;
                        }
                        .pui-icon {
                            font-size: 40px;
                            margin-bottom: 10px;
                            border: 2px solid $text_light;
                        }
                        img {
                            width: 50px;
                            background: #fff;
                        }
                        .name {
                            height: 36px;
                            width: 100%;
                            font-size: 12px;
                            overflow: hidden;
                            text-overflow: ellipsis;
                            display: -webkit-box;
                            -webkit-box-orient: vertical;
                            -webkit-line-clamp: 2;
                            text-align: center;
                            word-wrap: break-word;
                        }
                    }
                }
            }
        }
        &.search-tab {
            .tabs-content {
                position: relative;
                padding: 10px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                flex-direction: column;
                .search-content {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    height: 34px;
                    box-sizing: border-box;
                    flex-shrink: 0;
                    width: 100%;
                    .pui-input {
                        background: $bg-home_light;
                        flex: 1;
                        height: 100%;
                        .pui-popper {
                            .inline-block {
                                width: 100%;
                                .pui-input {
                                    height: 34px;
                                    width: 100%;
                                    .pui-input_frame {
                                        background: $bg-home_light;
                                    }
                                }
                            }
                        }
                    }
                    .tools {
                        height: 100%;
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        flex-direction: column;
                        .tools-item {
                            width: 25px;
                            height: 14px;
                            background: $bg-home_light;
                            border-radius: 4px;
                            display: flex;
                            justify-content: center;
                            align-items: center;
                            cursor: pointer;
                            &:hover {
                                background: $bg-tool_light;
                            }
                        }
                    }
                }
                .file-content {
                    flex: 1;
                    .file-list {
                        overflow-y: auto;
                        padding: 0;
                    }
                }
                .filter-content {
                    border-radius: 4px;
                    border: 1px solid $border_light;
                    box-sizing: border-box;
                    position: relative;
                    background-color: #fff;
                    z-index: 1;
                    margin-bottom: 10px;
                    .pui-tabs {
                        border-radius: 0px;
                    }
                    .filter-list {
                        position: absolute;
                        top: 31px;
                        left: 0;
                        width: 100%;
                        height: 0px;
                        transition: height 0.3s ease-in-out;
                        overflow-y: auto;
                        background-color: #fff;
                        // border: 1px solid $border_light;
                        box-sizing: border-box;
                        border-radius: 0 0 4px 4px;
                        box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.12);
                        &.show {
                            height: 180px;
                        }
                        .filter-item {
                            padding: 10px;
                            .item {
                                display: flex;
                                justify-content: flex-start;
                                align-items: flex-start;
                                flex-direction: column;
                                .pui-checkbox {
                                    margin-left: 0;
                                }
                            }
                        }
                    }
                }
            }
            .file-content {
                flex: none;
                height: 230px;
                flex-shrink: 0;
                box-sizing: border-box;
                width: 100%;
                position: relative;
                display: flex;
                justify-content: space-between;
                flex-direction: column;
                .file-info {
                    width: 100%;
                    display: flex;
                    flex-wrap: wrap;
                    align-items: flex-start;
                    justify-content: flex-start;
                    box-sizing: border-box;
                    .file-info-item {
                        width: 100%;
                        padding: 10px;
                        font-size: 12px;
                        display: flex;
                        justify-content: space-between;
                        color: $text_light;
                        &:nth-child(2n - 1) {
                            background: $bg-tool_light;
                        }
                    }
                }
            }
        }
        &.compo-tab {
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-direction: column;
            .tabs-content {
                position: relative;
                background: $bg-home_light;
                .search-content {
                    position: sticky;
                    top: 0;
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    box-sizing: border-box;
                    width: 100%;
                    padding: 10px;
                    z-index: 1;
                    background: #fff;
                    .pui-search {
                        background: $bg-home_light;
                        flex: 1;
                        .pui-popper {
                            .inline-block {
                                width: 100%;
                                .pui-input {
                                    height: 34px;
                                    width: 100%;
                                    .pui-input_frame {
                                        background: $bg-home_light;
                                    }
                                }
                            }
                        }
                    }
                    .tools {
                        height: 34px;
                        flex-shrink: 0;
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        flex-direction: column;
                        .tools-item {
                            width: 25px;
                            height: 14px;
                            background: $bg-home_light;
                            border-radius: 4px;
                            display: flex;
                            justify-content: center;
                            align-items: center;
                            cursor: pointer;
                            &:hover {
                                background: $bg-tool_light;
                            }
                        }
                    }
                }
                .compo-list-content {
                    .compo-drawer {
                        position: relative;
                        box-sizing: border-box;
                        border-bottom: 1px solid #fff;
                        .compo-drawer__header {
                            height: 30px;
                            position: relative;
                            display: flex;
                            justify-content: space-between;
                            align-items: center;
                            padding: 0 2px 0 10px;
                            background: $bg-home_light;
                            .compo-drawer__header__left {
                                .pui-icon {
                                    font-size: 12px;
                                    cursor: pointer;
                                    &:hover {
                                        background: $border-deep_light;
                                    }
                                }
                                .title {
                                    font-size: 12px;
                                }
                            }
                            .compo-drawer__header__right {
                                .pui-icon {
                                    font-size: 16px;
                                    cursor: pointer;
                                    &:hover {
                                        background: $border-deep_light;
                                    }
                                }
                            }
                        }
                        .compo-drawer__list {
                            padding: 10px;
                            display: flex;
                            flex-wrap: wrap;
                            align-items: flex-start;
                            justify-content: flex-start;
                            box-sizing: border-box;
                            .compo-item {
                                &:nth-child(2n-1) {
                                    margin-right: 10px;
                                }
                                &.nom {
                                    margin-bottom: 0;
                                }
                                width: 70px;
                                height: 70px;
                                display: flex;
                                flex-direction: column;
                                align-items: center;
                                justify-content: center;
                                cursor: pointer;
                                transition: all 0.3s ease-in-out;
                                margin-bottom: 10px;
                                border-radius: 4px;
                                &:hover {
                                    background: $border-deep_light;
                                }
                                &.active-item {
                                    background: $border-deep_light;
                                }
                                .pui-icon {
                                    font-size: 24px;
                                    margin-bottom: 5px;
                                }
                                img {
                                    width: 40px;
                                }
                                .name {
                                    height: 20px;
                                    width: 100%;
                                    font-size: 12px;
                                    overflow: hidden;
                                    text-overflow: ellipsis;
                                    display: -webkit-box;
                                    -webkit-box-orient: vertical;
                                    -webkit-line-clamp: 2;
                                    text-align: center;
                                    word-wrap: break-word;
                                }
                                
                            }
                        }
                    }
                }
            }
            .file-content {
                height: 40%;
                .pui-table {
                    th, td {
                        font-size: 12px;
                        padding: 8px;
                    }
                    th {
                        font-weight: bold;
                    }
                    td {
                        border: none;
                    }
                }
            }
        }
    }
    .pui-tabs {
        width: 100%;
        border-radius: 0px;
        border-right: 0;
        border-bottom: 0;
        flex-shrink: 0;
        height: 32px;
        box-sizing: border-box;
        .pui-tabs_content {
            width: 100%;
            .pui-tab {
                padding: 0;
                margin: 0;
                &.active-tab {
                    &:nth-child(2) {
                        border-left: none !important;
                    }
                }
            }
        }
    }
    &.tree-list-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        .tab-item {
            flex-shrink: 0!important;
            flex: 1;
            overflow: auto;
            width: 100%;
            box-sizing: border-box;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-direction: column;
            .tree-content {
                flex-shrink: 0!important;
                flex: 1;
                overflow: auto;
                width: 100%;
                box-sizing: border-box;
                padding: 15px 10px;
                &.border-btm {
                    border-bottom: 10px solid $border_light;
                }
            }
        }
    }
}

@mixin resource-drawer-content-dark {
    .resource-tab {
        .tabs-content {
            border-bottom: 10px solid $border_dark!important;
            background-color: $bg-home_dark!important;
            .tabs-sticky {
                background-color: $bg-home_dark!important;
                .pui-tabs {
                    .pui-tabs_content {
                        .pui-tab {
                            &.active-tab {
                                box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.4);
                            }
                            &:hover {
                                box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.4);
                            }
                        }
                    }
                }
            }
            .tabs-tree {
                .pui-tree {
                    .pui-tree_box {
                        border-color: $border_dark;
                        .pui-tree-children {
                            .pui-tree-children_content {
                                .pui-tree-children_content-list {
                                    .pui-tree-children_content-item {
                                        overflow: hidden;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        .file-content {
            .file-list {
                .file-item {
                    &:hover {
                        background: $border-deep_dark!important;
                    }
                    &.active-item {
                        background: $border-deep_dark!important;
                    }
                    .pui-icon {
                    }
                    .name {
                    }
                }
            }
            .pui-table {
                table {
                    thead {
                        tr {
                            th {
                                background: $bg-selected_dark!important;
                            }
                        }
                    }
                    tbody {
                        tr {
                            td {
                                background-color: $bg-home_dark!important;
                            }
                            &:nth-child(2n) {
                                td {
                                    background: $bg-selected_dark!important;
                                }
                            }
                        }
                    }
                }
            }
        }
        &.search-tab {
            .tabs-content {
                .search-content {
                    .pui-input {
                        background: $bg-home_dark!important;
                    }
                    .pui-search {
                        background: $border-deep_dark;
                        .pui-popper {
                            .inline-block {
                                .pui-input {
                                    background: $border-deep_dark;
                                    .pui-input_frame {
                                        background: $border-deep_dark!important;
                                    }
                                }
                            }
                        }
                    }
                    .tools {
                        .tools-item {
                            background: $border-deep_dark;
                            cursor: pointer;
                            &:hover {
                                background: $bg-selected_dark;
                            }
                        }
                    }
                }
                .filter-content {
                    border: none!important;
                    background-color: $border-deep_dark;
                    .pui-tabs {
                        .pui-tab {
                        }
                    }
                    .filter-list {
                        // border: 1px solid $border_dark;
                        box-shadow: 0px 3px 5px 0px $bg-tool_dark;
                        background-color: $border-deep_dark!important;
                        .filter-item {
                            .item {
                                .pui-checkbox {
                                }
                            }
                        }
                    }
                }
            }
            .file-content {
                .file-info {
                    .file-info-item {
                        color: $text-font_dark!important;
                        &:nth-child(2n - 1) {
                            color: $text-font_dark!important;
                            background: $border-deep_dark!important;
                        }
                    }
                }
            }
        }
        &.compo-tab {
            .search-content {
                background: $bg-home_dark!important;
                transition: all;
                .pui-input {
                    background: $bg-home_dark!important;
                }
                .pui-search {
                    background: $border-deep_dark;
                    .pui-popper {
                        .inline-block {
                            .pui-input {
                                background: $border-deep_dark;
                                .pui-input_frame {
                                    background: transparent!important;
                                }
                            }
                        }
                    }
                }
                .tools {
                    .tools-item {
                        background: $border-deep_dark!important;
                        cursor: pointer;
                        &:hover {
                            background: $bg-selected_dark!important;
                        }
                    }
                }
            }
        }
    }
    .pui-tabs {
        .pui-tabs_content {
            .pui-tab {
                &.active-tab {
                    background: $bg-home_dark !important;
                }
                &:hover {
                    background: $bg-home_dark !important;
                }
            }
        }
    }
}
